import axios from 'axios'
import router from "../../../router/index"
export default function limit(link) {
  let url = " /api/login/user";
  axios
    .post(url)
    .then(out => {
      console.log(out.data.result.urlList)
      let list = out.data.result.urlList;
      if (list == null) {
        list = [];
      }
      let flag = 0;
      for (let i in list) {
        if (link == list[i]) {
          flag++;
        }
      }
      if (flag == 0) {
        router.push({
          name: "noRight"
        });
      }
    })
    .catch(error => {});
  // setTimeout(() => {
  //   let list = ["/indexNotice/outbox", "/indexNotice/outbox/outboxdetails/:year/:type", "/indexNotice/outbox/newNotice"];
  //   let flag = 0;
  //   for (let i in list) {
  //     if (link == list[i]) {
  //       flag++;
  //     }
  //   }
  //   if (flag == 0) {
  //     router.push({
  //       name: "noRight"
  //     });
  //   }
  // }, 2000);

}
